<template>
  <div class="soleSong">
    <div class="title">
      <span>
        独家放送
        <i class="iconfont iconarrow-right"></i>
      </span>
    </div>
    <div class="solebody">
      <div v-for="item in soleSongList" :key="item.id" class="soleDetail">
        <img :src="item.picUrl" alt width="200" height="90" />
        <div class="solePlay">
          <i class="iconfont icon24gl-play"></i>
        </div>
        <div class="soleName">
          <span>{{item.name}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
type soleSongT = {
  id: number
  name: string
  picUrl: string
}
import { onMounted, ref } from 'vue'
import axios from '@/http.ts'
onMounted(() => {
  getSoleSongList()
})
const soleSongList = ref<Array<soleSongT>>([])
const getSoleSongList = () => {
  axios.get('/personalized/privatecontent/list?limit=4').then(res => {
    res.data.code === 200 && (soleSongList.value = res.data.result)
  })
}
</script>

<style lang="scss" scoped>
.soleSong {
  padding: 16px;
  .title {
    color: #b2b2b2;
    overflow: hidden;
    font-weight: bolder;
    margin-bottom: 10px;
    margin-left: 20px;
    &:hover {
      color: #fff;
      cursor: pointer;
    }
  }
  .solebody {
    display: flex;
    .soleDetail {
      color: #b3b3b3;
      flex: 1;
      text-align: center;
      position: relative;
      img {
        border-radius: 5px;
        &:hover {
          cursor: pointer;
        }
      }
    }
    .solePlay {
      position: absolute;
      width: 21px;
      height: 21px;
      border: 1px solid #6d5b56;
      border-radius: 50%;
      background-color: rgba(0, 0, 0, 0.3);
      top: 6px;
      left: 25px;
      .iconfont {
        position: absolute;
        font-size: 12px;
        color: #fff;
        bottom: 4px;
        left: 2px;
        right: 0;
        margin: auto;
      }
    }
    .soleName {
      padding: 0 19px;
      text-align: left;
      font-size: 13px;
      font-weight: bolder;
      height: 80px;
      span {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        &:hover {
          color: #fff;
          cursor: pointer;
        }
      }
    }
  }
}
</style>